import { createApp } from "vue";
import "./style.css";
import App from "./App.vue";
import { setupPrimeVue } from "./config/primevue.config";
import { setupI18n } from "./config/i18n.config";
import { setupPiniaStore } from "./config/pinia.config";
import router, { setupRouter } from "./config/router.config";

import "primeicons/primeicons.css";
import "primeflex/primeflex.css";
// Vuetify
import "vuetify/styles";
import { createVuetify } from "vuetify";
import { pl, zhHans } from "vuetify/locale";
import { aliases, mdi } from "vuetify/iconsets/mdi";
// import { aliases, mdi } from "vuetify/iconsets/mdi-svg";
import "@mdi/font/css/materialdesignicons.css";
import ToastService from "primevue/toastservice";
async function loadApp() {
  const app = createApp(App);
  setupPrimeVue(app);
  setupI18n(app);
  setupPiniaStore(app);
  setupRouter(app);
  const vuetify = createVuetify({
    locale: {
      locale: "zhHans",
      fallback: "sv",
      messages: { zhHans, pl },
    },
    icons: {
      defaultSet: "mdi",
      aliases,
      sets: {
        mdi,
      },
    },
  });
  app.use(vuetify);
  app.use(ToastService);

  await router.isReady();
  app.mount("#app");
}

loadApp();
